<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\Admin\Setting;
use Illuminate\Http\Request;


class SettingController extends Controller
{
    public function index(Request $request)
    {
        $res=['title'=>'网站设置'];
        $getarr = ['sitename','siteurl'];
        return Setting::op($request,$getarr,$res,'admin.setting.index','admin.setting');
    }

    public function sms(Request $request)
    {
        $res=['title'=>'短信设置'];
        $getarr = ['sms_ali_id','sms_ali_key','sms_ali_sign','sms_ali_tcode',
            'sms_ali_tcode','sms_ali_mnum','sms_ali_ipsms'];
        return Setting::op($request,$getarr,$res,'admin.setting.sms','admin.sms');
    }

    public function wechat(Request $request)
    {
        $res=['title'=>'微信登录'];
        $getarr = ['mp_appid','mp_appkey','redirect','dev_appid','dev_appkey','min_appid','min_appkey'];
        return Setting::op($request,$getarr,$res,'admin.setting.wechat','admin.wechat');
    }

    public function oss(Request $request)
    {
        $res=['title'=>'oss设置'];
        $getarr = ['oss_status','oss_size','oss_unused','oss_zoom','oss_quality','oss_width','oss_ext','oss_http',
            'oss_host','oss_bucket','oss_accesskey_id','oss_accesskey_secret','oss_bucketname'];
        return Setting::op($request,$getarr,$res,'admin.setting.oss','admin.oss');
    }

    public function payAli(Request $request)
    {
        $res=['title'=>'支付包设置'];
        $getarr = ['pay_alipay_status','pay_alipay_appid','pay_alipay_seller_id','pay_alipay_publickey',
            'pay_alipay_merchantprivatekey'];
        return Setting::op($request,$getarr,$res,'admin.setting.payali','admin.payali');
    }

    public function payWechat(Request $request)
    {
        $res=['title'=>'微信支付设置'];
        $getarr = ['pay_wechat_appid','pay_wechat_mchid','pay_wechat_status','pay_wechat_privateKey',
            'pay_wechat_certNo','pay_wechat_key','pay_wechat_appsecret',
            'pay_wechat_min_appid','pay_wechat_min_appsecret','pay_wechat_app_appid'];
        return Setting::op($request,$getarr,$res,'admin.setting.paywechat','admin.paywechat');
    }
}
